# -*- coding: utf-8 -*- 

"""
This file is part of PeerTool, a web application for collaborative
decision-making (Copyrighted, 2009-2010, Ellis & Grant, Inc.)
Developed by Michael F. Ellis <michael.f.ellis@gmail.com>.  
License: AGPL v3
PeerTool comes with ABSOLUTELY NO WARRANTY.
"""                
class PeerToolConfig(object):
    """ 
    Defines various limits and parameters for the PeerTool application.
    The limits are mainly to prevent abuse in public instances of the
    application. They're probably not going to help much against a
    coordinated DOS attack, so plan to deploy other defenses if you have
    reason to believe that's a risk for your site.
    """
    def __init__(self,
        development = True,                 # set to False for production 
                                            # deployment

        maxSxC = 400,                       # limits the product of
                                            # solutions and criteria 
                                            # allowed in a problem. 
                                            # The default limit corresponds 
                                            # to 20 solutions and 20 
                                            # criteria, or 10 solutions 
                                            # and 40 criteria, etc..

        maxGzProblem = 1e6,                 # total compressed size 
                                            # of a serialized problem 
                                            # object may not exceed this.
                
        maxInvitations=200,                 # Per-problem limit to number 
                                            # of invited participants.

        maxCreationsPerHour=30,             # Limits the rate at which 
                                            # an individual user can 
                                            # define new problems.

        tos=False,                          # When set to True, the
                                            # the registration page will
                                            # display "Terms of Service"
                                            # and "Privacy Policy" from
                                            # db.legal. You will need to
                                            # provide appropriate content
                                            # in fields with those names in
                                            # db.legal.
        
        synonyms = dict(                    # You can specify alternate
                                            # default names for fundamental 
                                            # concepts in PeerTool
            problem = "problem",
            problems = "problems",
            solution = "idea",
            solutions = "ideas",
            criterion = "criterion",
            criteria = "criteria",
        ),
        ):
        self.__dict__.update(locals())
        syn = self.synonyms                 
        tmp = dict()
        for i,j in syn.iteritems():         # Make initial caps entries 
            tmp[i.title()] = j.title()      # in synonym table          
        syn.update(tmp)

